#include <iostream>
#include "down.h"
#include "update.h"
#include "test.h"

using namespace std;

int main()
{
    Bejmatrix BM;
    default_random_engine generator(time(0));
    uniform_int_distribution<int> distribution(1, 4);
    for(int i=0;i<8;i++)
    {
        for(int j=0;j<8;j++)
        {
            BM.arr[i][j]= distribution(generator);
            BM.boolarrx[i][j]=1;
            BM.boolarry[i][j]=1;
            cout<<BM.arr[i][j]<<" ";
        }
        cout<<endl;
    }
    update(BM.arr,BM.boolarrx,BM.boolarry);
    int num = 1;
    while(num!=0)
    {
        cout<<"请输入两个点各自的坐标:"<<endl;
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        int temp=0;
        temp=BM.arr[x1-1][y1-1];
        BM.arr[x1-1][y1-1]=BM.arr[x2-1][y2-1];
        BM.arr[x2-1][y2-1]=temp;
        update(BM.arr,BM.boolarrx,BM.boolarry);
    }
    return 0;
}